<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script type="text/javascript">
        //倒计时
        function countDowm(time){
            var nowTime = + new Date();        //返回的是当前时间得总得毫秒数
            var inputTime = + new Date(time);  //返回的是输入时间总的毫秒数
            var times = (inputTime - nowTime) / 1000;   //Time是剩余时间得总的毫秒数
            var d = parseInt(times / 60 / 60 / 24);//天
            d = d < 10 ? '0' + d : d;
            var h = parseInt(times  / 60 /60 %24);//时
            h = h < 10 ? '0' + h : h;
            var m = parseInt(times / 60 %60);//分			
            m = m < 10 ? '0' + m : m;
            var s = parseInt(times  %60);//当前的秒数
            s = s < 10 ? '0' + s : s;
            return d + '天' + h + '时' + m +'分' + s +'秒';
        }
        console.log(countDowm('2025-11-11 12:00:00'));
        var date = new Date();
        console.log(date);
    
        //计算日期
        function getweekday(date){
            var weekArray = new Array("星期日","星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
            var week  = weekArray[new Date(date).getDay()];
            return week;
        }
        var rq =getweekday('2025-11-11')
        console.log(rq)
        
    </script>
</body>
</html>